Make gtk_icon_theme_add_resource_path public API
authorMatthias Clasen <mclasen@redhat.com>
Fri, 20 Jun 2014 04:46:09 +0000 (00:46 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 30 Jun 2014 21:13:04 +0000 (17:13 -0400)
This makes it possible to look up icons in resources using
the icon theme api, and should be used as a replacement
for installing icons below $pkgdatadir/icons and adding
that location to the search path.

docs/reference/gtk/gtk3-sections.txt
gtk/gtkicontheme.c
gtk/gtkicontheme.h

index f32a782c06bd94c6d47f3bbc0d183864aa598ee5..02a48afc09b568b404782b782b440a5c72c86ff6 100644 (file)
@@ -6696,6 +6696,7 @@ gtk_icon_theme_set_search_path
 gtk_icon_theme_get_search_path
 gtk_icon_theme_append_search_path
 gtk_icon_theme_prepend_search_path
+gtk_icon_theme_add_resource_path
 gtk_icon_theme_set_custom_theme
 gtk_icon_theme_has_icon
 gtk_icon_theme_lookup_icon
index acd6ff36edd3ff6293e7a42baddb91ab393e8911..f715af8acb51d76fccc2363d3e0a1da7509a790e 100644 (file)
@@ -1001,6 +1001,25 @@ gtk_icon_theme_prepend_search_path (GtkIconTheme *icon_theme,
   do_theme_change (icon_theme);
 }
 
+/**
+ * gtk_icon_theme_add_resource_path:
+ * @icon_theme: a #GtkIconTheme
+ * @path: a resource path
+ *
+ * Adds a resource path that will be looked at when looking
+ * for icons, similar to search paths.
+ *
+ * This function should be used to make application-specific icons
+ * available as part of the icon theme.
+ *
+ * The resources are considered as part of the hicolor icon theme
+ * and must be located in subdirectories that are defined in the
+ * hicolor icon theme, such as `@path/16x16/actions/run.png`.
+ * Icons that are directly placed in the resource path instead
+ * of a subdirectory are also considered as ultimate fallback.
+ *
+ * Since: 3.14
+ */
 void
 gtk_icon_theme_add_resource_path (GtkIconTheme *icon_theme,
                                   const gchar  *path)
index 6d7fab2537a89b6bf2df4c3264a914b9a69b0eee..e37a52dd9d6335876cb680b52f8f5d937cf97213 100644 (file)
@@ -187,6 +187,10 @@ GDK_AVAILABLE_IN_ALL
 void          gtk_icon_theme_prepend_search_path   (GtkIconTheme                *icon_theme,
                                                    const gchar                 *path);
 
+GDK_AVAILABLE_IN_3_14
+void          gtk_icon_theme_add_resource_path     (GtkIconTheme                *icon_theme,
+                                                    const gchar                 *path);
+
 GDK_AVAILABLE_IN_ALL
 void          gtk_icon_theme_set_custom_theme      (GtkIconTheme                *icon_theme,
                                                    const gchar                 *theme_name);